function clearElement(elementName) {
    var tbl = document.getElementById(elementName);
    while (tbl.firstChild) {
        tbl.removeChild(tbl.firstChild);
    }
}